package com.lyc.controller;

import com.lyc.pojo.City;
import com.lyc.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.logging.Level;

@Controller
@RequestMapping("/city")
@CrossOrigin
public class CityController {
    @Autowired
    private CityService cityService;

    @RequestMapping(value = "/shengshi",method = RequestMethod.GET)
    @ResponseBody
    public List<City> selectSS(){
        List<City> list = cityService.selectSS();
        return list;
    }
    @RequestMapping(value = "/chengshi/{cid}",method = RequestMethod.GET)
    @ResponseBody
    public List<City> selectCS(@PathVariable("cid") int cid){
        List<City> list = cityService.selectCS(cid);
        return list;
    }
    @RequestMapping(value = "/quxian/{cid}",method = RequestMethod.GET)
    @ResponseBody
    public List<City> selectQX(@PathVariable("cid") int cid){
        List<City> list = cityService.selectQX(cid);
        return list;
    }
}
